Do not BUG when receiving unexpected message type from xenbus
authorvhanquez@kneesa.uk.xensource.com <vhanquez@kneesa.uk.xensource.com>
Wed, 15 Mar 2006 11:09:45 +0000 (11:09 +0000)
committervhanquez@kneesa.uk.xensource.com <vhanquez@kneesa.uk.xensource.com>
Wed, 15 Mar 2006 11:09:45 +0000 (11:09 +0000)
print a warning and discard the query

Signed-off-by: Vincent Hanquez <vincent@xensource.com>
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_xs.c

index ad43b0ca35ff4b839cb6a7f60f557d1201014342..a388a84ffcd54a2947268685f042e9a03bb9b9ab 100644 (file)
@@ -237,7 +237,14 @@ static void *xs_talkv(xenbus_transaction_t t,
                return ERR_PTR(-err);
        }
 
-       BUG_ON(msg.type != type);
+       if (msg.type != type) {
+               if (printk_ratelimit())
+                       printk(KERN_WARNING
+                              "XENBUS unexpected type [%d], expected [%d]\n",
+                              msg.type, type);
+               kfree(ret);
+               return ERR_PTR(-EINVAL);
+       }
        return ret;
 }